package com.yupi.springbootinit.aop;

import com.yupi.springbootinit.annotation.TestAop;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;


/**
 * @Classname TestAopInterceptor
 * @Description TODO
 * @Date 2023/10/15 17:14
 * @Created by Daivd
 */
@Aspect
@Component
public class TestAopInterceptor {

    @Around("@annotation(testAop)")
    public Object around(ProceedingJoinPoint joinPoint, TestAop testAop) throws Throwable {
        String username = testAop.username();
        System.out.println(username);
        Object proceed = joinPoint.proceed();
        return proceed;
    }
}
